package com.asj.house.client;

import com.asj.house.config.feign.HouseRoomResourceFeignConfig;
import com.asj.house.domain.HouseRoomResource;
import com.asj.house.returns.RespEntity;
import com.asj.house.returns.RespTable;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "houseRoomResourceClient", url = "${manage.url}", configuration = HouseRoomResourceFeignConfig.class)
public interface HouseRoomResourceClient {

    /**
     * 房源信息列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/house-room-resource/list")
    RespTable listHouseRoomResource(@RequestParam(value = "page", required = true) Integer page,
                                    @RequestParam(value = "limit", required = true) Integer limit);

    /**
     * 搜索房源信息
     * @param page
     * @param limit
     * @param name
     * @return
     */
    @GetMapping("/house-room-resource/list")
    RespTable searchHouseRoomResource(@RequestParam("page") Integer page,
                                      @RequestParam("limit") Integer limit,
                                      @RequestParam("name") String name);

    /**
     * 编辑房源信息
     * @param houseRoomResource
     * @return
     */
    @PutMapping("house-room-resource/update")
    RespEntity updateHouseRoomResource(@RequestBody HouseRoomResource houseRoomResource);

}
